<template>
  <div id="app">
    <h3>案例：折叠面板</h3>
    <Pennel>
      <img
        src="../assets/1.gif"
        alt=""
      >
      <p>这是父组件传递过来的 HTML 标签结构</p>
    </Pennel>
    <Pennel>
      <p>窗前明月光</p>
      <p>地上鞋两双</p>
    </Pennel>
    <!-- 没有传递内容，会使用 slot 的默认内容 -->
    <Pennel></Pennel>
  </div>
</template>

<script>
import Pennel from "./components/Pennel.vue";
export default {
  components: {
    Pennel: Pennel,
  },
};
</script>

<style lang="less">
// yarn add less@3.0.4 less-loader@5.0.0 -D    此案例使用了less语法, 项目中下载模块
body {
  background-color: #ccc;
  #app {
    width: 400px;
    margin: 20px auto;
    background-color: #fff;
    border: 4px solid blueviolet;
    border-radius: 1em;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    padding: 1em 2em 2em;
    h3 {
      text-align: center;
    }
    .title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid #ccc;
      padding: 0 1em;
    }
    .title h4 {
      line-height: 2;
      margin: 0;
    }
    .container {
      border: 1px solid #ccc;
      padding: 0 1em;
    }
    .btn {
      /* 鼠标改成手的形状 */
      cursor: pointer;
    }
  }
}
</style>